home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap06 / DlgDemo3 / DlgDemo3.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  1.8 KB  |  84 lines

  1. //***********************************************************************
  2. //
  3. //  DlgDemo3.h
  4. //
  5. //***********************************************************************
  6.  
  7. class CMyApp : public CWinApp
  8. {
  9. public:
  10.     virtual BOOL InitInstance ();
  11. };
  12.  
  13. class CMainWindow : public CFrameWnd
  14. {
  15. private:
  16.     int m_nFillType;
  17.     int m_nFillColor;
  18.     CString m_text;
  19.     int m_nHeight;
  20.     BOOL m_bBold;
  21.     BOOL m_bItalic;
  22.  
  23.     void DoSolidFill (CDC*, CRect*);
  24.     void DoGradientFill (CDC*, CRect*);
  25.     void DoDrawText (CDC*, CRect*);
  26.  
  27. public:
  28.     CMainWindow ();
  29.  
  30. protected:
  31.     afx_msg BOOL OnEraseBkgnd (CDC*);
  32.     afx_msg void OnPaint ();
  33.     afx_msg void OnOptionsSettings ();
  34.     afx_msg void OnOptionsExit ();
  35.     afx_msg void OnOptionsAbout ();
  36.  
  37.     DECLARE_MESSAGE_MAP ()
  38. };
  39.  
  40. class CSettingsDialog : public CDialog
  41. {
  42. private:
  43.     CEdit& ctlText () { return *(CEdit*) GetDlgItem (IDC_TEXT); }
  44.     CEdit& ctlHeight () { return *(CEdit*) GetDlgItem (IDC_HEIGHT); }
  45.     CButton& ctlBold () { return *(CButton*) GetDlgItem (IDC_BOLD); }
  46.     CButton& ctlItalic () { return *(CButton*) GetDlgItem (IDC_ITALIC); }
  47.     int GetCheckedRadioButton (int, int);
  48.  
  49. public:
  50.     int m_nFillType;
  51.     int m_nFillColor;
  52.     CString m_text;
  53.     int m_nHeight;
  54.     BOOL m_bBold;
  55.     BOOL m_bItalic;
  56.  
  57.     CSettingsDialog (CWnd* pParentWnd = NULL) :
  58.         CDialog (IDD_SETTINGSDLG, pParentWnd) {}
  59.  
  60.     virtual BOOL OnInitDialog ();
  61.  
  62. protected:
  63.     virtual void OnOK ();
  64.  
  65.     afx_msg void OnDefaults ();
  66.     DECLARE_MESSAGE_MAP ()
  67. };
  68.  
  69. class CAboutDialog : public CDialog
  70. {
  71. private:
  72.     CRect m_rect;
  73.  
  74. public:
  75.     CAboutDialog (CWnd* pParentWnd = NULL) :
  76.         CDialog (IDD_ABOUTDLG, pParentWnd) {}
  77.  
  78.     virtual BOOL OnInitDialog ();
  79.  
  80. protected:
  81.     afx_msg void OnPaint ();
  82.     DECLARE_MESSAGE_MAP ()
  83. };
  84.